package ru.averta.notes.dao.impl;

import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import ru.averta.notes.dao.UserDao;
import ru.averta.notes.domain.User;

@Repository
public class UserDaoImpl extends GenericDaoHibernateImpl<User, Long> implements UserDao {

    public User findUserByMail(String mail) {
        return (User) createCriteria().add(Restrictions.eq(User.DAO_F_MAIL, mail)).uniqueResult();
    }
}
